﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace SH.LMS.Common.UI
{
    [ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)]
    public class ServiceFactory : IDisposable
    {
        public static T CreateServiceChannel<T>(string endpointAddress)
        {
            var binding = new WSHttpBinding("wsHttp");
            var endpoint = new EndpointAddress(endpointAddress);

            ChannelFactory<T> channelFactory = new ChannelFactory<T>(binding, endpoint);

            return channelFactory.CreateChannel();
        }

        public void Dispose()
        {
            throw new NotImplementedException();
        }
    }
}
